﻿using WebApiTest1.Middlewares;

namespace WebApiTest1.Extensions
{
    public static class MiddlewareExtension
    {
        public static void UseMyCustomMiddleware(this IApplicationBuilder app)
        {
            app.UseMiddleware<MyCustomMiddleware>();
        }

        public static void UseConventionalMiddleware(this IApplicationBuilder app)
        {
            app.UseMiddleware<ConventionalMiddleware>();
        }

        public static IApplicationBuilder UseRequestCulture(this IApplicationBuilder builder)
        {
            return builder.UseMiddleware<RequestCultureMiddleware>();
        }

        public static IApplicationBuilder UseFactoryActivatedMiddleware(
            this IApplicationBuilder app)
            => app.UseMiddleware<FactoryActivatedMiddleware>();
    }
}
